﻿using System.ComponentModel.DataAnnotations;
using YuYuKiCms.Framework.Localization;

namespace YuYuKiCms.Model
{
    /// <summary>
    /// This view model is use for register a new user
    /// </summary>
    public class RegistrationVm
    {
        [Required]
        [DisplayNameFromDb("UserName")]
        public string UserName { get; set; }

        [Required]
        [DisplayNameFromDb("Email")]
        [DataType(DataType.EmailAddress)]
        [RemoteFromDb("IsEmailAvailable", "Validation", "email_used")]
        public string Email { get; set; }

        [Required]
        [DisplayNameFromDb("ConfirmEmail")]
        [DataType(DataType.EmailAddress)]
        [CompareFromDb("Email", "Confirm_email_msg")]
        public string ConfirmEmail { get; set; }

        [Required]
        [DisplayNameFromDb("Password")]
        [DataType(DataType.Password)]
        public string Password { get; set; }

        [Required]
        [DisplayNameFromDb("ConfirmPassword")]
        [DataType(DataType.Password)]
        [CompareFromDb("Password", "Login_ConfirmPassword_Passwordnotequal")]
        public string ConfirmPassword { get; set; }
    }
}